package homework.api01.apitest01;

public class IndexOfDemo {
    public static void main(String[] args) {
        String str = "thinking in Java";
                    //01234567
        int index = str.indexOf("in");
        System.out.println(index);//2

        index = str.indexOf("in",3);
        System.out.println(index);//5

        index = str.lastIndexOf("in");
        System.out.println(index);//9

        index = str.indexOf("cc");
        System.out.println(index);//-1
    }
}
